﻿using AppsModel.APIModel;
using MVC_basic.Data_Layer;
using MVC_basic.Data_Layer.Interface;
using MVC_basic.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;

namespace AppsApi.Controllers
{
    public class AppsController : ApiController
    {
        public List<App> Get()
        {
            IdbApp db = new dbApp();
            List<App> apps = db.getApps();
            List<APIApp> apiapps = new List<APIApp>();
            /*foreach (App app in apps)
            {
                APIApp apiapp = APIApp.AppToAPI(app);
                apiapps.Add(apiapp);
            }*/
            return apps;
        }

        public App Get(int id)
        {
            IdbApp db = new dbApp();
            App app = db.getApp(id);
            //APIApp apiapp = null;// APIApp.AppToAPI(app);
            return app;
        }
    }
}
